<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>航班列表</title>
    <script type="text/javascript" src="<%=basePath%>js/jquery-1.3.1.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/splitPage.css">
	<script type="text/javascript">
		 $(function(){
				$("#page").change(function(){
					var page = $("#page").val();
					window.location.href="FlightInfo!getAllFlightInfo?page=" + page;
				});
				$("#keyWord").focus(function() {
					$("#keyWord").val("");
				}) ;
			});
	</script>
	
  </head>
  
  <body topmargin="0" bgcolor="#D6DFF7" >
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr bgcolor="#DEE5FA">
    <td align="center" >
     <form name="conditionForm" action="FlightInfo!getFlightsByKeyWords"
		method="post">
		<table border="0" width="100%">
			<tr bgcolor="#799AE1" height="40">
				<td>
					<input id="keyWord" name="keyWord" type="text" value="请输入关键字" />
					<input value="搜索" type="submit" />
				</td>
			</tr>
		</table>
	</form>
	<table width="100%" cellspacing="1" border="0" id="xtable" bordercolor="#799AE1">
				<thead>
				<tr height="50" >
					<th colspan="11" >
							<font color="#874B46" size="4pt">航班信息</font>
					</th>
				</tr>
		<tr  bgcolor="#799AE1" height="40" align="center" >
        	<td width="10%">航班号</td>
            <td width="10%">航班编号</td>
            <td width="15%">起飞</td>
			<td width="15%">到达</td>
            <td width="10%">旅程次数</td>
			<td width="10%">容纳人数</td>
            <td width="10%">票价(CNY)</td>
            <td width="10%">操作</td>
            <td width="10%">操作</td>
			
         </tr>
    </thead>
    <s:if test="pageBean.list.size == 0">
	<tr>
		<td>
			暂无数据!
		</td>
	</tr>
	</s:if>
	<s:iterator value="pageBean.list">
		<tr height="30">
			<td align="center" >
				<s:property value="id" />
			</td>
			<td align="center" >
				<s:property value="flight_name" />
			</td>
			<td align="center" >
				<s:property value="start_flight" />
			</td>
			<td align="center" >
				<s:property value="end_flight" />
			</td>
			<td align="center" >
				<s:property value="times" />
			</td>
			<td align="center" >
				<s:property value="capacity" />
			</td>
			<td align="center" >
				<s:property value="price" />
			</td>
			<td align="center" >
				<a
					href="FlightInfo!getAllFlightById?id=<s:property value="id" />">修改</a>
			</td>
			<td align="center" >
				<a
					href="FlightInfo!deleteFlightById?id=<s:property value="id" />">删除</a>
			</td>
			
		</tr>
	</s:iterator>
        </table>
        <tr>
        	<td height="25px">
			<table width="100%" border="0">
				<tr bgcolor="#DEE5FA">
					<td width="30%" align="left">
						共检索到
						<s:property value="pageBean.allRow" />
						条记录
					</td>
					<td align="right" id="pagelist">
						  <ul>
						  	<li>
						  		 <select name="page" id="page">
							  		<%--<option value="1">页码</option>--%>
							  	<s:iterator value="pageBean.pageNumbers" status="pageNumbers">
								  	<s:iterator value="pageBean.pageNumbers[#pageNumbers.index]">
							  		<option value="<s:property/>"><s:property/></option>
								  	</s:iterator>
							  	</s:iterator>
							</select>
						  	</li>
						    <li class="pageinfo">共<s:property value="pageBean.totalPage" />页</li>
						    <li class="pageinfo">第<s:property value="pageBean.currentPage" />页</li>
						    <s:if test="%{pageBean.currentPage != pageBean.totalPage}">
								<li><a href="FlightInfo!getAllFlightInfo?page=<s:property value="pageBean.totalPage"/>">尾页</a></li>
								<li><a href="FlightInfo!getAllFlightInfo?page=<s:property value="%{pageBean.currentPage+1}"/>">下一页</a></li>
							</s:if>
						  	<s:if test="%{pageBean.currentPage == 1}"></s:if>
						  	<s:else>
								<li><a href="FlightInfo!getAllFlightInfo?page=<s:property value="%{pageBean.currentPage-1}"/>">上一页</a></li>
								<li><a href="FlightInfo!getAllFlightInfo?page=1">首页</a></li>
							</s:else>
						  </ul>
					</td>
				</tr>
		</table>
		</td>
		</tr>	
	  </body>
</html>
